package com.dingding.order.core.tourism.biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.dingding.common.core.beans.special.Tourviewspot;
import com.dingding.common.core.util.ToolUtil;
import com.dingding.order.core.tourism.biz.ITourviewspotService;
import com.dingding.order.core.tourism.dao.ITourviewspotDao;
import com.dingding.order.dto.publish.special.TourismRouteDTO;

/**
 * 
 * @ClassName: TourviewspotServiceImpl 
 * @Description: 旅游路线Service实现类 
 * @author YHQ
 * @date 2016年8月22日 下午8:22:23
 * @since V2.4.0
 * 
 */
@Component("tourviewspotService")
public class TourviewspotServiceImpl implements ITourviewspotService {

	@Resource(name="tourviewspotDao")
	private ITourviewspotDao tourviewspotDao;
	
	/**
	 * 
	 * @Title: geTourviewspots 
	 * @Description: 获取旅游路线列表
	 * @param tourismRouteDTO 获取旅游路线请求Bean
	 * @author YHQ 
	 * @since V2.4.0
	 * @return List<Tourviewspot>    返回类型
	 * 
	 */
	@Override
	public List<Tourviewspot> geTourviewspots(TourismRouteDTO tourismRouteDTO) {
		
		List<Tourviewspot> tourviewspots = tourviewspotDao.tourviewspots(tourismRouteDTO.getCityNo());
		
		if(tourviewspots != null && tourviewspots.size() > 0){
			
			for (Tourviewspot tourviewspot : tourviewspots) {
				
				tourviewspot.setViewSpotImage(ToolUtil.imageAddress(tourviewspot.getViewSpotImage()));
				
			}
		}
		
		return tourviewspots;
	}

}
